This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2000-301521, filed Sep. 29, 2000, the entire contents of which are incorporated herein by reference.
1. Field of the Invention
The present invention relates to determination of a write error of a nonvolatile memory during a write operation, and in particular, to a method of writing data to a nonvolatile memory that can distinguish errors resulting from faults in the entire system from errors resulting from defects only in the memory, as well as the nonvolatile memory incorporating such a determining function.
2. Description of the Related Art
As storage devices in which various digital information represented by image or music data is saved, stamp-sized memory cards has recently become popular which comprises a rewritable nonvolatile semiconductor memory mounted therein and preventing saved information from being lost even if a power supply is turned off.
Typical rewritable nonvolatile memories include NAND type flash memories. This type of flash memory is controlled for each block of a fixed size (for example, 512 bytes), and unused blocks are indicated by status data xe2x80x9c1.xe2x80x9d Once the write operation for a block is completed, the status data for the block is changed from xe2x80x9c1xe2x80x9dto xe2x80x9c0xe2x80x9d. After the data is written, it is determined whether or not the data is correctly written. Not only if the data is correctly written but also if a write error is occurred, the status data for that block is changed from xe2x80x9c1xe2x80x9d to xe2x80x9c0xe2x80x9d to inhibit the subsequent use thereof. A retry process is executed for data that is not correctly written to a certain block. If a write error occurs during this retry process, the status data for that block is also changed to xe2x80x9c0xe2x80x9d.
The write to the nonvolatile memory involves two operations: a single-write operation that is completed by writing data to one block, the smallest write unit, and a multiple-write operation that is completed by repeating a single write a number of times. If, however, a write error occurs, the same process is executed in both cases.
If the write operation is completed, it is determined whether or not the data is correctly written, and a block to which the data is not correctly written is determined to be defective and its status data is changed from xe2x80x9c1xe2x80x9d to xe2x80x9c0xe2x80x9d to inhibit the subsequent use thereof. The determination of a defective block results not only from a memory factor but also from a system-wise factor (for example, an insufficient write voltage). Thus, when the status data for a defective block is changed from xe2x80x9c1xe2x80x9d to xe2x80x9c0xe2x80x9d so as to be immediately inhibited from subsequent use of the block, that block cannot be used even if the write error arises from a system-wise factor but the memory is not defective. Thus, the conventional method of writing data to the nonvolatile memory may consider normal blocks as abnormal, thereby unnecessarily reducing the capacity of the memory card to shorten its lifetime.
It is an object of the present invention to provide a method of writing data to a nonvolatile memory as well as a nonvolatile memory that determines whether a write error originates from a system-wise factor (the memory may be normal) or a memory factor, to prevent normal blocks from being considered as abnormal, therefore, the capacity of the nonvolatile memory being prevented from being unnecessarily reduced.
According to one aspect to the present invention, a rewritable nonvolatile memory comprising:
a block usage control table which indicates a usage status of each block of the nonvolatile memory;
a data write section configured to write data;
a determining section configured to determine whether or not the data is correctly written, and storing an address of a given block if it is determined that the data is not correctly written to the given block; and
a control table updating section configured to update the block usage control table, if the determining section determines that the data is correctly written to a present block, such that the usage status of the given block and the present block is changed to a used status.
According to another aspect to the present invention, a method of writing data to a rewritable nonvolatile memory comprising a block usage control table which indicates a usage status of each block of the nonvolatile memory, the method comprising:
writing data;
determining whether or not the data is correctly written, and storing an address of a given block if it is determined that the data is not correctly written to the given block; and
updating the block usage control table, if it is determined that the data is correctly written to a present block, such that the usage status of the given block and the present block is changed to a used status.
Therefore, according to the present invention, it is determined whether a write error originates from a system-wise factor or a memory factor and normal blocks are prevented from being considered as abnormal.